package cion.springCloudClient;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;


@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients
@EnableCircuitBreaker
//@EnableHystrix
public class AppClient {
	
	public static void main(String[] args) {
		ConfigurableApplicationContext ctx = SpringApplication.run(AppClient.class, args);
//		String temp = ctx.getEnvironment().getProperty("service.url");
		//http://localhost:9991/actuator/hystrix.stream
	}
	@Bean
	@LoadBalanced
    RestTemplate restTemplate() {
        return new RestTemplate();
    }
}
